#ifndef _IMAGE_H
#define _IMAGE_H


#include "..\Figure\Point.h"
#include "..\Color\Color.h"
#include "..\Container\SurfaceContainer.h"
#include "..\Exceptions\ImagePathNotFoundException.h"
#include "..\SDL\include\SDL_image.h"
#include <vector>

class Image{

	private:
		int figureHeight, figureWidth; //segun la figura a la que corresponda
		int imageWidth;
		int imageHeight;
		Point *imageCenter, *figureCenter; //segun la figura a la que corresponda
		std::string imagePath;

		unsigned char *rarray; //array con los colores de cada pixel :)
		unsigned char *garray;
		unsigned char *barray;
		bool error;

public:
	
	SDL_Surface *image; // puntero a la imagen
	Image();
	Image(const std::string &imagePath);

	bool validarLimites(std::vector<Point*> *puntos);
	
	int getImageWidth() { return imageWidth; };
	int getImageHeight() { return imageHeight; };
	Point *getImageCenter() { return imageCenter; };

	void setFigureWidth(int anchoFig) { figureWidth = anchoFig; };
	void setFigureHeight(int altoFig) { figureHeight = altoFig; };
	void setFigureCenter(Point *centroFig) { figureCenter = centroFig; };

	Color* getColor(Point* punto);
	Color* getColor(int x,int y);
	SDL_Surface* getImagen();

	virtual ~Image();

};

#endif